package org.d11_object_stream;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * 目标：掌握对象字节输入流的使用：反序列化对象
 */
public class Test2ObjectOutPutStream {
    public static void main(String[] args) {
        try(
                //1.创建一个对象字节输入流管道，包装低级的字节输入流与源文件接通
                ObjectInputStream ois = new ObjectInputStream(new FileInputStream("D:\\idea\\idea code\\java-practice\\practice\\change\\file-oi-app\\src\\test\\d11test.txt"));

        ) {
            User u = (User) ois.readObject();
            System.out.println(u);

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
